import 'package:flutter/material.dart';
import 'package:syria_sports/core/app_export.dart';

import 'appbar_leading_image.dart';

class OutlineIconButton extends StatelessWidget {
  final Function? onTapped;
  final String? imagePath;
  final IconData? icon;
  final EdgeInsets? padding;
  final EdgeInsets? margin;
  final Color? borderColor;
  final double? height;
  final double? width;

  const OutlineIconButton({
    super.key,
    this.onTapped,
    this.imagePath,
    this.icon,
    this.padding,
    this.margin,
    this.borderColor, this.height, this.width,
  });

  @override
  Widget build(BuildContext context) {
    return InkWell(
      onTap: () {
        onTapped?.call();
      },
      child: Container(
        height:height?? 38,
        width:width?? 38,
        margin: margin ?? const EdgeInsets.all(8,),
        padding: padding ?? const EdgeInsets.all(4),
        alignment: Alignment.center,
        decoration: BoxDecoration(
          color: Colors.black26,
          borderRadius: BorderRadius.circular(8),
          border: Border.all(color: borderColor ?? Colors.white24, width: 2),
        ),
        child: icon != null
            ? Icon(
                icon!,
                size: 18,
              )
            : AppbarLeadingImage(imagePath: imagePath,),
      ),
    );
  }
}
